package cn.csxw.openchina.ui.fragment.myFragment;


import android.os.Bundle;
import android.support.annotation.Nullable;

import java.util.ArrayList;

import javax.inject.Inject;

import cn.csxw.openchina.base.BaseRecAdapter;
import cn.csxw.openchina.base.BaseRefreshFragment;
import cn.csxw.openchina.dagger2.component.DaggerMyFollowFragmentComponent;
import cn.csxw.openchina.dagger2.module.MyFollowFragmentModues;
import cn.csxw.openchina.dagger2.presenter.MyFollowFragmentPresenter;
import cn.csxw.openchina.entity.bean.FriendBean;
import cn.csxw.openchina.ui.adapter.MyFollowAdapter;
import cn.csxw.openchina.utils.Global;

/**
 * 关注Fragment中的关注
 */
public class MyFollowFragment extends BaseRefreshFragment {

    public MyFollowAdapter mAdapter;
    @Inject
    public MyFollowFragmentPresenter mMyFollowFragmentPresenter;
    @Override
    protected BaseRecAdapter getAdapter() {
        ArrayList<FriendBean> friendBeanList  =new ArrayList<>();
        if (mAdapter == null) {
            mAdapter = new MyFollowAdapter(friendBeanList);
        }
        return mAdapter;
    }

    @Override
    public void doRefresh() {

    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
       DaggerMyFollowFragmentComponent.builder().myFollowFragmentModues(
                new MyFollowFragmentModues(this)).build().inject(this);
        mMyFollowFragmentPresenter.callNetWork("993896",0,20,1);
        Global.onNetworkStateListener(mMyFollowFragmentPresenter,this);

    }
}
